Page({
  data: {
    controls: [{
      id: 1,
      iconPath: '../../img/gps.png',
      position: {
        left: 0,
        top: 300 - 50,
        width: 30,
        height: 30
      },
      clickable: true
    }],
    latitude: '',
    longitude: '',
    placeData: {}
  },
  onLoad: function () {
    wx.getLocation({
      type: 'gcj02',
      success: (res) => {
        this.setData({
          latitude:res.latitude,
          longitude:res.longitude,
          markers: [{
            iconPath: "../../img/marker_red.png",
            id: 0,
            latitude: res.latitude,
            longitude: res.longitude,
            width: 25,
            height: 25
          }]
        })
        console.log(this.data.latitude)
        console.log(this.data.longitude)
      }
    })

  },
  controltap(e) {
    console.log('controlId')
    console.log(e.controlId)
    wx.getLocation({
      type: 'gcj02',
      success: (res) => {
        this.setData({
          latitude: res.latitude,
          longitude: res.longitude
        })
      }
    })
  },
  markertap(e) {
    console.log(e.markerId)
    console.log('markerId')
  },
  regionchange(e) {
    console.log(e.type)
    console.log('regionchange')
  }
})